class Solution {
public:
    int lengthOfLastWord(string s) {
        stringstream ss(s);
        string a,b;
        while (ss>>a){b=a;}
        return b.size();
    }
};
